﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace hm_restaurant.View
{
    public partial class Frm_printer : Form
    {
        public Frm_printer()
        {
            InitializeComponent();
        }

        private void btn_add_printer_Click(object sender, EventArgs e)
        {
            Frm_printer_add printer_Add = new Frm_printer_add();
            if (printer_Add.ShowDialog() == DialogResult.OK)
            {
                string location=printer_Add.location;
                string interfaces=printer_Add.interfaces;
                string pageSize=printer_Add.pageSize;
                string ip=printer_Add.ip;
                Boolean active=printer_Add.active;

                DataTable table = new DataTable();
                table.Columns.Add("id");
                table.Columns.Add("location");
                table.Columns.Add("interfaces");
                table.Columns.Add("pagesize");
                table.Columns.Add("ip");
                table.Columns.Add("active");

                DataRow r1=table.NewRow();
                r1["id"] = 0;
                r1["location"] = location;
                r1["interfaces"] = interfaces;
                r1["pagesize"] = pageSize;
                r1["ip"] = ip;
                r1["active"] = active;

                table.Rows.Add(r1);

                dgv_printer.DataSource = table;


            }


        }
    }
}
